//
//  WYNewViewController.m
//  Boss
//
//  Created by admin on 2018/7/27.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYNewViewController.h"
#import "WYLoginController.h"
#import "WYBaseNavigationController.h"
@interface WYNewViewController ()
@property (strong, nonatomic) IBOutlet UIImageView *handImageView;

@end

@implementation WYNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CAKeyframeAnimation *shakeAnim = [CAKeyframeAnimation animation];
    
    shakeAnim.keyPath = @"transform.translation.y";
    
    shakeAnim.duration = 0.8;
    
    CGFloat delta = 10;
    
    shakeAnim.values = @[@10 , @(-delta), @(delta), @10];
    
    shakeAnim.repeatCount = MAXFLOAT;
    
    [self.handImageView.layer addAnimation:shakeAnim forKey:nil];
    self.view.backgroundColor = [UIColor clearColor];
    
    
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)clickAction:(id)sender {
    [self.view removeFromSuperview];
        NSString *token = [WYStoreModule currentToken];
        if (!token.length) {
            
            WYLoginController *loginVc = [[WYLoginController alloc] initWithNibName:@"WYLoginController" bundle:nil];
            WYBaseNavigationController *nav = [[WYBaseNavigationController alloc]initWithRootViewController:loginVc];
            [self presentViewController:nav animated:YES completion:nil];
        }else{
            NSUserDefaults *TimeOfBootCount = [NSUserDefaults standardUserDefaults];
            [TimeOfBootCount setValue:@"2" forKey:@"time"];
            [TimeOfBootCount synchronize];
            if (self.complete) {
                self.complete();
            }
            
            
        }
    
   
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
